$(document).ready(function() {
	Vue.component('item', {
		props: ['item'],
		template: `
			<div class="itemInfo">
			<div v-show="item.label" v-bind:style="label">{{item.label}}</div>
				<a href="#"><img v-bind:src='item.src' width="200px" height="200px"/></a>
				<a href="#"><p>{{item.name}}</p></a>
				<font>{{item.price | price()}}</font>
				<div>
					<a href="#"><span>{{item.status}}</span></a>
					<span>已有{{item.evaluate}}人评价</span>
				</div>
			</div>
		`,
		data: function() {
			return {
				label: {
					width: '50px',
					height: '50px',
					borderRadius: '50%',
					background: this.item.labelColor,
					position: 'absolute',
					top: '180px',
					right: '10px',
					lineHeight: '50px',
					textAlign: 'center',
					color: "white",
				}
			};
		},
	});
	Vue.filter('price', function(val) {
		val = val || 0;
		return "¥" + val;
	})
	var item = new Vue({
		el: "#itemList",
		data: {
			items: [{
					id: 1,
					name: "荣耀手环3荣耀手环3荣耀手环3荣耀手环3荣手环3aaaaaaaaaabbbbb",
					price: 200,
					src: "img/zxy/goodsListForClassify/手环3.jpg",
					status: "选购",
					evaluate: 30,
					label: "热卖",
					labelColor: "red",
				},
				{
					id: 2,
					name: "荣耀 MagicBook 笔记本电脑12 小时长续航 独显轻薄",
					price: 3400,
					src: "img/zxy/goodsListForClassify/手环3.jpg",
					status: "选购",
					evaluate: 30,
					label: false,
					labelColor: "blue",
				},
				{
					id: 3,
					name: "荣耀 MagicBook 笔记本电脑12 小时长续航 独显轻薄",
					price: 3400,
					src: "img/zxy/goodsListForClassify/手环3.jpg",
					status: "选购",
					evaluate: 30,
					label: "新品",
					labelColor: "yellow",
				},
				{
					id: 4,
					name: "荣耀 MagicBook 笔记本电脑12 小时长续航 独显轻薄",
					price: 3400,
					src: "img/zxy/goodsListForClassify/手环3.jpg",
					status: "选购",
					evaluate: 30,
					label: false,
					labelColor: "yellow",
				},
				{
					id: 5,
					name: "荣耀 MagicBook 笔记本电脑12 小时长续航 独显轻薄",
					price: 3400,
					src: "img/zxy/goodsListForClassify/手环3.jpg",
					status: "选购",
					evaluate: 30,
					label: "新品",
					labelColor: "yellow",
				},
				{
					id: 6,
					name: "荣耀 MagicBook 笔记本电脑12 小时长续航 独显轻薄",
					price: 3400,
					src: "img/zxy/goodsListForClassify/手环3.jpg",
					status: "选购",
					evaluate: 30,
					label: "新品",
					labelColor: "green",
				},
			]
		},
	});

	var pageContent = new Vue({
		el: "#pageContent",
		data: {
			selectfcName:"手机",
			selectscName:"荣耀",
			fcNames:[
				"手机","平板&笔记本电脑","手环"
			],
			scNames:[
				"荣耀系列","麦芒系列"
			],
		},
	});
})